package com.ruoyi.deeplearn.service.impl;

import java.util.List;

import cn.hutool.core.util.IdUtil;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.deeplearn.mapper.DeepModelDatasetMapper;
import com.ruoyi.deeplearn.domain.DeepModelDataset;
import com.ruoyi.deeplearn.service.IDeepModelDatasetService;

/**
 * 模型Service业务层处理
 * 
 * @author rww
 * @date 2022-12-22
 */
@Service
public class DeepModelDatasetServiceImpl implements IDeepModelDatasetService 
{
    @Autowired
    private DeepModelDatasetMapper deepModelDatasetMapper;

    /**
     * 查询模型
     * 
     * @param id 模型主键
     * @return 模型
     */
    @Override
    public DeepModelDataset selectDeepModelDatasetById(Long id)
    {
        return deepModelDatasetMapper.selectDeepModelDatasetById(id);
    }

    /**
     * 查询模型列表
     * 
     * @param deepModelDataset 模型
     * @return 模型
     */
    @Override
    public List<DeepModelDataset> selectDeepModelDatasetList(DeepModelDataset deepModelDataset)
    {
        return deepModelDatasetMapper.selectDeepModelDatasetList(deepModelDataset);
    }

    /**
     * 新增模型
     * 
     * @param deepModelDataset 模型
     * @return 结果
     */
    @Override
    public int insertDeepModelDataset(DeepModelDataset deepModelDataset)
    {
        deepModelDataset.setId(IdUtil.getSnowflakeNextId());
        deepModelDataset.setCreateTime(DateUtils.getNowDate());
        return deepModelDatasetMapper.insertDeepModelDataset(deepModelDataset);
    }

    /**
     * 修改模型
     * 
     * @param deepModelDataset 模型
     * @return 结果
     */
    @Override
    public int updateDeepModelDataset(DeepModelDataset deepModelDataset)
    {
        deepModelDataset.setUpdateTime(DateUtils.getNowDate());
        return deepModelDatasetMapper.updateDeepModelDataset(deepModelDataset);
    }

    /**
     * 批量删除模型
     * 
     * @param ids 需要删除的模型主键
     * @return 结果
     */
    @Override
    public int deleteDeepModelDatasetByIds(Long[] ids)
    {
        return deepModelDatasetMapper.deleteDeepModelDatasetByIds(ids);
    }

    /**
     * 删除模型信息
     * 
     * @param id 模型主键
     * @return 结果
     */
    @Override
    public int deleteDeepModelDatasetById(Long id)
    {
        return deepModelDatasetMapper.deleteDeepModelDatasetById(id);
    }
}
